//
// Created by 徐套 on 2023/10/8.
//

#ifndef CAR_CLOUD_SERVER_CAR_CONTRAL_H
#define CAR_CLOUD_SERVER_CAR_CONTRAL_H

#include "connection/server.h"
#include "code_c/car_state.h"
#include <vector>
#include <string>




class car_contral {
public:
    car_contral()= default;

    ~car_contral();

    void send_msg_by_udp(char *msg);

    bool send_msg_by_tcp(char *msg);

    bool have_car_server();

    void add_car_server(const std::shared_ptr<cloud_server>& ser);

    std::string get_time_late();

    std::string is_alive();

    void alive();

    void pop_server(int ser);

    AllCar get_all_state();

    void reset();

private:
    std::vector<std::shared_ptr<cloud_server>> car_server;
    AllCar car_;
};


#endif //CAR_CLOUD_SERVER_CAR_CONTRAL_H
